package com.hnkywl.sts.action.report;

import com.hnkywl.sts.service.report.PjkcService;
import com.hnkywl.sts.service.report.YdcbService;
import net.ruixin.web.struts2.SimpleActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-6-14
 * Time: 下午4:48
 * To change this template use File | Settings | File Templates.
 */
@Namespace("/report/ydcb")
public class YdcbAction extends SimpleActionSupport {
    private Long gsId;
    private YdcbService ydcbService;
    private int page ;
    private int rows  ;
    private String name;
    private String code;
    private String ggxh;


    @Action("ydcb")
    public String pjkc() {
        return SUCCESS;
    }

    @Action("ydcbList")
    public void ydcbList() {
            Date nowDate = new Date();
            if(code !=null && ggxh !=null && name !=null  ){
                code = code.trim();
                ggxh = ggxh.trim();
                name = name.trim();
            }
            String json = ydcbService.ydcbList(gsId,nowDate,code,ggxh,name,page,rows);
            renderJson(json);
    }

    //=================setter getter==============
    public Long getGsId() {
        return gsId;
    }

    public void setGsId(Long gsId) {
        this.gsId = gsId;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getGgxh() {
        return ggxh;
    }

    public void setGgxh(String ggxh) {
        this.ggxh = ggxh;
    }

    //=================setter===================
    @Autowired
    public void setYdcbService(YdcbService ydcbService) {
        this.ydcbService = ydcbService;
    }
}
